package com.example.springboot0507.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * @author 王博
 */
@Component
@Slf4j
public class DataSourceShow implements ApplicationContextAware {
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        Object jdbcTemplate = applicationContext.getBean("jdbcTemplate");
        log.info("信息为：{}",jdbcTemplate);
    }
}
